#https://oracle.github.io/python-cx_Oracle/

from __future__ import print_function

import cx_Oracle

# Connect as user "hr" with password "welcome" to the "oraclepdb" service running on this computer.
connection = cx_Oracle.connect("hopetargle", "hopetargle", "192.168.1.31/orcl")

cursor = connection.cursor()
cursor.execute("""
    SELECT emp_name
    FROM pub_employee
    WHERE job_num = :did
    """,
    did = 'JJ004')

 
for emp_name in cursor:
    print("Values:", emp_name)

"""
D:\CODE2019\python\py-thothpzgl>python 01select.py
Values: ('葛JJ004',)

D:\CODE2019\python\py-thothpzgl>
"""